from django.db import models
from utils.basemodel import BaseModel
# Create your models here.
class NavModel(BaseModel):
    navname = models.CharField(max_length=50,verbose_name="导航名称")
    position = models.BooleanField(default=True,verbose_name="导航位置")
    link = models.CharField(max_length=200,verbose_name="链接")
    ishttp = models.BooleanField(default=False,verbose_name="是否是http链接")
    class Meta:
        db_table = 'fgnav'

    def __str__(self):
        return self.navname

class BannerModel(BaseModel):
    title = models.CharField(max_length=50,verbose_name="标题")
    fimg = models.ImageField(upload_to="uploads",verbose_name="图片")
    link = models.CharField(max_length=200,verbose_name="链接",default="#")
    ishttp = models.BooleanField(default=False,verbose_name="是否是http链接")
    class Meta:
        db_table = 'fgbanner'

    def __str__(self):
        return self.title